//
//  FDButton.m
//  FamousDoctorOnline
//
//  Created by wszyxc on 16/7/7.
//  Copyright © 2016年 wszyxc. All rights reserved.
//

#import "FDButton.h"


@implementation FDButton


- (void)setup
{
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
 
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setup];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    // 设置图片位置

    
//    [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
//        
//        make.centerX.equalTo(self);
//        make.width.height.offset(60);
//        make.top.offset(20);
//        
//    }];


    self.imageView.width = self.width/2;
    self.imageView.height = self.imageView.width;
    self.imageView.x = self.width/2 - self.imageView.width/2;
    self.imageView.y = 25;
    
    // 设置文字label位置
    
    
//    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//       
////        make.leading.trailing.offset(0);
////        make.bottom.offset(20);
//        
//        make.leading.trailing.offset(0);
//        make.top.equalTo(self.imageView.mas_bottom).offset(10);
//        
//    }];
//
    self.titleLabel.x = 0;
    self.titleLabel.y = self.imageView.height + 15;
    self.titleLabel.width = self.width;
    self.titleLabel.height = self.height - self.titleLabel.y;
    
}


- (void)setHighlighted:(BOOL)highlighted{
    
    
}






@end
